// import { login, hotGoods, taskCount, orderCount, orderAmount } from '@/api/user'
// import { setToken, getToken } from '@/utils/storage'

export default {
  namespaced: true,
  state: {
    // token: getToken(),
    // success: '',
    // start: '',
    // end: '',
    // list: '',
    // year: '',
    // month: '',
    // date: '',
    // week: '',
    // taskList: [],
    // orderList: [],
    // amountList: []
  },
  mutations: {
    // setTokenFn (state, data) {
    //   state.token = data.token
    //   state.success = data.success
    //   // console.log(data.token)
    //   setToken(data.token)
    // },
    // getTime (state, time) {
    //   state.start = time.start
    //   state.end = time.end
    //   state.year = time.year
    //   state.month = time.month + 1
    //   state.date = time.date
    //   state.week = time.week
    // },
    // hotlist (state, list) {
    //   state.list = list
    // },
    // getTask (state, taskList) {
    //   state.taskList = taskList
    // },
    // getOrder (state, List) {
    //   state.orderList = List.arr
    //   state.amountList = List.amountArr
    // }
  },
  actions: {
    // async loginAction (context, payload) {
    //   // console.log(payload)
    //   const res = await login(payload)
    //   // console.log(res)
    //   context.commit('setTokenFn', res)
    // },
    // async goodsList (context, payload) {
    //   // console.log(payload)
    //   const res = await hotGoods(payload)
    //   console.log(payload)
    //   const start = payload.start + ' ' + '00:00:00'
    //   const end = payload.end + ' ' + '23:59:59'
    //   console.log(start)
    //   // const data = { start, end }
    //   const arr = await orderCount({ start, end })
    //   const amountArr = await orderAmount({ start, end })
    //   // console.log(arr)
    //   context.commit('getOrder', { arr, amountArr })
    //   context.commit('hotlist', res)
    // },
    // async getshijian (context, payload) {
    //   const start = payload.start
    //   const end = payload.end
    //   const res = await taskCount({ start, end })
    //   context.commit('getTask', res)
    //   context.commit('getTime', payload)
    // }

  }
}
